Remove relocations from the atk factories. Remove unused gail_foo_new()
authorChristian Persch <chpe@src.gnome.org>
Tue, 25 Dec 2007 09:29:46 +0000 (09:29 +0000)
committerChristian Persch <chpe@src.gnome.org>
Tue, 25 Dec 2007 09:29:46 +0000 (09:29 +0000)
* modules/other/gail/*.[ch]: Remove relocations from the atk
factories. Remove unused gail_foo_new() functions. Fix object
instantiation to be derivation safe by moving initialisation code
from the removed gail_foo_new() functions to the
AtkObjectClass::initialize implementation. Bug #505226.

svn path=/trunk/; revision=19237

91 files changed:
ChangeLog
modules/other/gail/Makefile.am
modules/other/gail/gail.c
modules/other/gail/gail.h
modules/other/gail/gailadjustment.c
modules/other/gail/gailarrow.c
modules/other/gail/gailarrow.h
modules/other/gail/gailbooleancellfactory.c [deleted file]
modules/other/gail/gailbooleancellfactory.h [deleted file]
modules/other/gail/gailbox.c
modules/other/gail/gailbox.h
modules/other/gail/gailbutton.c
modules/other/gail/gailbutton.h
modules/other/gail/gailcalendar.c
modules/other/gail/gailcalendar.h
modules/other/gail/gailclist.c
modules/other/gail/gailclist.h
modules/other/gail/gailcombo.c
modules/other/gail/gailcombo.h
modules/other/gail/gailcombobox.c
modules/other/gail/gailcombobox.h
modules/other/gail/gailcontainer.c
modules/other/gail/gailcontainer.h
modules/other/gail/gailentry.c
modules/other/gail/gailentry.h
modules/other/gail/gailexpander.c
modules/other/gail/gailexpander.h
modules/other/gail/gailfactory.h
modules/other/gail/gailframe.c
modules/other/gail/gailframe.h
modules/other/gail/gailhtmlbox.c
modules/other/gail/gailhtmlbox.h
modules/other/gail/gailimage.c
modules/other/gail/gailimage.h
modules/other/gail/gailimagecellfactory.c [deleted file]
modules/other/gail/gailimagecellfactory.h [deleted file]
modules/other/gail/gailitem.c
modules/other/gail/gailitem.h
modules/other/gail/gaillabel.c
modules/other/gail/gaillabel.h
modules/other/gail/gaillist.c
modules/other/gail/gaillist.h
modules/other/gail/gailmenu.c
modules/other/gail/gailmenu.h
modules/other/gail/gailmenushell.c
modules/other/gail/gailmenushell.h
modules/other/gail/gailnotebook.c
modules/other/gail/gailnotebook.h
modules/other/gail/gailobject.c
modules/other/gail/gailobject.h
modules/other/gail/gailobjectfactory.c [deleted file]
modules/other/gail/gailobjectfactory.h [deleted file]
modules/other/gail/gailoptionmenu.c
modules/other/gail/gailoptionmenu.h
modules/other/gail/gailpaned.c
modules/other/gail/gailpaned.h
modules/other/gail/gailpixmap.c
modules/other/gail/gailpixmap.h
modules/other/gail/gailprogressbar.c
modules/other/gail/gailprogressbar.h
modules/other/gail/gailradiobutton.c
modules/other/gail/gailradiobutton.h
modules/other/gail/gailrange.c
modules/other/gail/gailrange.h
modules/other/gail/gailrenderercellfactory.c [deleted file]
modules/other/gail/gailrenderercellfactory.h [deleted file]
modules/other/gail/gailscale.c
modules/other/gail/gailscale.h
modules/other/gail/gailscrollbar.c
modules/other/gail/gailscrollbar.h
modules/other/gail/gailscrolledwindow.c
modules/other/gail/gailscrolledwindow.h
modules/other/gail/gailseparator.c
modules/other/gail/gailseparator.h
modules/other/gail/gailspinbutton.c
modules/other/gail/gailspinbutton.h
modules/other/gail/gailstatusbar.c
modules/other/gail/gailstatusbar.h
modules/other/gail/gailtextcellfactory.c [deleted file]
modules/other/gail/gailtextcellfactory.h [deleted file]
modules/other/gail/gailtextview.c
modules/other/gail/gailtextview.h
modules/other/gail/gailtogglebutton.c
modules/other/gail/gailtogglebutton.h
modules/other/gail/gailtoplevel.c
modules/other/gail/gailtoplevel.h
modules/other/gail/gailtreeview.c
modules/other/gail/gailtreeview.h
modules/other/gail/gailutil.c
modules/other/gail/gailwindow.c
modules/other/gail/gailwindow.h

index 8ac778728caf70df399d84dd5f919590d5642acf..3fb8c05da51e6772af9edc9f7a523a3fa0d05f05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-12-22  Christian Persch  <chpe@gnome.org>
+
+       * modules/other/gail/*.[ch]: Remove relocations from the atk
+       factories. Remove unused gail_foo_new() functions. Fix object
+       instantiation to be derivation safe by moving initialisation code
+       from the removed gail_foo_new() functions to the
+       AtkObjectClass::initialize implementation. Bug #505226.
+
 2007-12-24  Matthias Clasen  <mclasen@redhat.com>
 
        * modules/other/gail/gailentry.c:
index 56f27d34c79fe30a6765b838b320fb8085169db8..b864901e965352001bafd2bf9a6838e9b7c448b5 100644 (file)
@@ -15,7 +15,6 @@ gail_c_sources =                      \
        gailadjustment.c                \
        gailarrow.c                     \
        gailbooleancell.c               \
-       gailbooleancellfactory.c        \
        gailbox.c                       \
        gailbutton.c                    \
        gailcalendar.c                  \
@@ -34,7 +33,6 @@ gail_c_sources =                      \
        gailframe.c                     \
        gailimage.c                     \
        gailimagecell.c                 \
-       gailimagecellfactory.c          \
        gailitem.c                      \
        gaillabel.c                     \
        gaillist.c                      \
@@ -44,7 +42,6 @@ gail_c_sources =                      \
        gailnotebook.c                  \
        gailnotebookpage.c              \
        gailobject.c                    \
-       gailobjectfactory.c             \
        gailoptionmenu.c                \
        gailpaned.c                     \
        gailpixmap.c                    \
@@ -54,7 +51,6 @@ gail_c_sources =                      \
        gailradiosubmenuitem.c          \
        gailrange.c                     \
        gailrenderercell.c              \
-       gailrenderercellfactory.c       \
        gailscale.c                     \
        gailscrollbar.c                 \
        gailscrolledwindow.c            \
@@ -63,7 +59,6 @@ gail_c_sources =                      \
        gailsubmenuitem.c               \
        gailstatusbar.c                 \
        gailtextcell.c                  \
-       gailtextcellfactory.c           \
        gailtextview.c                  \
        gailtogglebutton.c              \
        gailtoplevel.c                  \
@@ -79,7 +74,6 @@ gail_private_h_sources =              \
        gailadjustment.h                \
        gailarrow.h                     \
        gailbooleancell.h               \
-       gailbooleancellfactory.h        \
        gailbox.h                       \
        gailbutton.h                    \
        gailcalendar.h                  \
@@ -99,7 +93,6 @@ gail_private_h_sources =              \
        gailframe.h                     \
        gailimage.h                     \
        gailimagecell.h                 \
-       gailimagecellfactory.h          \
        gailitem.h                      \
        gaillabel.h                     \
        gaillist.h                      \
@@ -109,7 +102,6 @@ gail_private_h_sources =            \
        gailnotebook.h                  \
        gailnotebookpage.h              \
        gailobject.h                    \
-       gailobjectfactory.h             \
        gailoptionmenu.h                \
        gailpaned.h                     \
        gailpixmap.h                    \
@@ -119,7 +111,6 @@ gail_private_h_sources =            \
        gailradiosubmenuitem.h          \
        gailrange.h                     \
        gailrenderercell.h              \
-       gailrenderercellfactory.h       \
        gailscale.h                     \
        gailscrollbar.h                 \
        gailscrolledwindow.h            \
@@ -128,7 +119,6 @@ gail_private_h_sources =            \
        gailsubmenuitem.h               \
        gailstatusbar.h                 \
        gailtextcell.h                  \
-       gailtextcellfactory.h           \
        gailtextview.h                  \
        gailtogglebutton.h              \
        gailtoplevel.h                  \
index 3f3126023e165eeb0d4ec03e6fd2e8cbc4cc97e4..66055607d8749b014d5bc3addcec6c476f1c595f 100644 (file)
@@ -70,44 +70,49 @@ static guint focus_notify_handler = 0;
 static guint focus_tracker_id = 0;
 static GQuark quark_focus_object = 0;
 
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WIDGET, gail_widget, gail_widget_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CONTAINER, gail_container, gail_container_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BUTTON, gail_button, gail_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ITEM, gail_item, gail_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_ITEM, gail_menu_item, gail_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, gail_toggle_button, gail_toggle_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_IMAGE, gail_image, gail_image_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TEXT_VIEW, gail_text_view, gail_text_view_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO, gail_combo, gail_combo_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_COMBO_BOX, gail_combo_box, gail_combo_box_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ENTRY, gail_entry, gail_entry_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU_SHELL, gail_menu_shell, gail_menu_shell_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_MENU, gail_menu, gail_menu_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_WINDOW, gail_window, gail_window_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RANGE, gail_range, gail_range_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCALE, gail_scale, gail_scale_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CLIST, gail_clist, gail_clist_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LABEL, gail_label, gail_label_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_STATUSBAR, gail_statusbar, gail_statusbar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_NOTEBOOK, gail_notebook, gail_notebook_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CALENDAR, gail_calendar, gail_calendar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PROGRESS_BAR, gail_progress_bar, gail_progress_bar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SPIN_BUTTON, gail_spin_button, gail_spin_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_TREE_VIEW, gail_tree_view, gail_tree_view_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_FRAME, gail_frame, gail_frame_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_BUTTON, gail_radio_button, gail_radio_button_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_ARROW, gail_arrow, gail_arrow_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PIXMAP, gail_pixmap, gail_pixmap_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SEPARATOR, gail_separator, gail_separator_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_BOX, gail_box, gail_box_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, gail_scrolled_window, gail_scrolled_window_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_LIST, gail_list, gail_list_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_PANED, gail_paned, gail_paned_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_SCROLLBAR, gail_scrollbar, gail_scrollbar_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_OPTION_MENU, gail_option_menu, gail_option_menu_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_CHECK_MENU_ITEM, gail_check_menu_item, gail_check_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_RADIO_MENU_ITEM, gail_radio_menu_item, gail_radio_menu_item_new)
-GAIL_ACCESSIBLE_FACTORY (GAIL_TYPE_EXPANDER, gail_expander, gail_expander_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OBJECT, GailObject, gail_object, GTK_TYPE_OBJECT)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ITEM, GailItem, gail_item, GTK_TYPE_ITEM)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_MENU_ITEM, GailMenuItem, gail_menu_item, gail_menu_item_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, GailToggleButton, gail_toggle_button, GTK_TYPE_TOGGLE_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_IMAGE, GailImage, gail_image, GTK_TYPE_IMAGE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TEXT_VIEW, GailTextView, gail_text_view, GTK_TYPE_TEXT_VIEW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO, GailCombo, gail_combo, GTK_TYPE_COMBO)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO_BOX, GailComboBox, gail_combo_box, GTK_TYPE_COMBO_BOX)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ENTRY, GailEntry, gail_entry, GTK_TYPE_ENTRY)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU, GailMenu, gail_menu, GTK_TYPE_MENU)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RANGE, GailRange, gail_range, GTK_TYPE_RANGE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE, GailScale, gail_scale, GTK_TYPE_SCALE)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CLIST, GailCList, gail_clist, GTK_TYPE_CLIST)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LABEL, GailLabel, gail_label, GTK_TYPE_LABEL)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CALENDAR, GailCalendar, gail_calendar, GTK_TYPE_CALENDAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_bar, GTK_TYPE_PROGRESS_BAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SPIN_BUTTON, GailSpinButton, gail_spin_button, GTK_TYPE_SPIN_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ARROW, GailArrow, gail_arrow, GTK_TYPE_ARROW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PIXMAP, GailPixmap, gail_pixmap, GTK_TYPE_PIXMAP)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LIST, GailList, gail_list, GTK_TYPE_LIST)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OPTION_MENU, GailOptionMenu, gail_option_menu, GTK_TYPE_OPTION_MENU)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new)
+GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
+GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_TEXT_CELL, GailTextCell, gail_text_cell, GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell_new)
 
 static AtkObject*
 gail_get_accessible_for_widget (GtkWidget *widget,
index 5ee6277c08f5c86daf1423fc62637b2f359c440c..69da60a739b094bfb05da6334b050a021d6970da 100644 (file)
@@ -1,7 +1,6 @@
 #include <gail/gailadjustment.h>
 #include <gail/gailarrow.h>
 #include <gail/gailbooleancell.h>
-#include <gail/gailbooleancellfactory.h>
 #include <gail/gailbox.h>
 #include <gail/gailbutton.h>
 #include <gail/gailcalendar.h>
@@ -18,7 +17,6 @@
 #include <gail/gailframe.h>
 #include <gail/gailimage.h>
 #include <gail/gailimagecell.h>
-#include <gail/gailimagecellfactory.h>
 #include <gail/gailitem.h>
 #include <gail/gaillabel.h>
 #include <gail/gaillist.h>
@@ -27,7 +25,6 @@
 #include <gail/gailmenuitem.h>
 #include <gail/gailnotebook.h>
 #include <gail/gailobject.h>
-#include <gail/gailobjectfactory.h>
 #include <gail/gailoptionmenu.h>
 #include <gail/gailpaned.h>
 #include <gail/gailpixmap.h>
@@ -35,7 +32,6 @@
 #include <gail/gailradiobutton.h>
 #include <gail/gailradiomenuitem.h>
 #include <gail/gailrenderercell.h>
-#include <gail/gailrenderercellfactory.h>
 #include <gail/gailrange.h>
 #include <gail/gailscale.h>
 #include <gail/gailscrollbar.h>
@@ -44,7 +40,6 @@
 #include <gail/gailspinbutton.h>
 #include <gail/gailstatusbar.h>
 #include <gail/gailtextcell.h>
-#include <gail/gailtextcellfactory.h>
 #include <gail/gailtextview.h>
 #include <gail/gailtogglebutton.h>
 #include <gail/gailtoplevel.h>
index a22aa9f6c1d45c4f90d8244eda6c89b78044759f..44df311f520b9bdff76b0e1d41042ec00a4c1762 100644 (file)
@@ -70,8 +70,6 @@ gail_adjustment_new (GtkAdjustment *adjustment)
 
   object = g_object_new (GAIL_TYPE_ADJUSTMENT, NULL);
 
-  g_return_val_if_fail (object != NULL, NULL);
-
   atk_object = ATK_OBJECT (object);
   atk_object_initialize (atk_object, adjustment);
 
index bece54bb79df4fc47231a8da3bd4a031eacdd341..fc1c72c6f7412206342a1fc16656cdad9023c0e6 100644 (file)
@@ -24,6 +24,8 @@
 
 static void gail_arrow_class_init      (GailArrowClass *klass);
 static void gail_arrow_init            (GailArrow      *arrow);
+static void gail_arrow_initialize       (AtkObject      *accessible,
+                                         gpointer        data);
 
 /* AtkImage */
 static void  atk_image_interface_init   (AtkImageIface  *iface);
@@ -41,6 +43,9 @@ static void
 gail_arrow_class_init          (GailArrowClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+  atk_object_class->initialize = gail_arrow_initialize;
 
   gobject_class->finalize = gail_arrow_finalize;
 }
@@ -51,21 +56,13 @@ gail_arrow_init (GailArrow *arrow)
   arrow->image_description = NULL;
 }
 
-AtkObject* 
-gail_arrow_new (GtkWidget *widget)
+static void
+gail_arrow_initialize (AtkObject *accessible,
+                       gpointer data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_ARROW (widget), NULL);
+  ATK_OBJECT_CLASS (gail_arrow_parent_class)->initialize (accessible, data);
 
-  object = g_object_new (GAIL_TYPE_ARROW, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
   accessible->role = ATK_ROLE_ICON;
-
-  return accessible;
 }
 
 static void
index b1e7fb272371135a5062c7123c40ed71f6942df7..7d58d78cf630b07f621b5396dc710a0a5fce1c22 100644 (file)
@@ -51,8 +51,6 @@ struct _GailArrowClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_arrow_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/modules/other/gail/gailbooleancellfactory.c b/modules/other/gail/gailbooleancellfactory.c
deleted file mode 100644 (file)
index fb003a7..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderertoggle.h>
-#include "gailbooleancellfactory.h"
-#include "gailbooleancell.h"
-
-static void gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass        *klass);
-
-static AtkObject* gail_boolean_cell_factory_create_accessible (
-                                GObject                              *obj);
-static GType gail_boolean_cell_factory_get_accessible_type (void);
-
-GType
-gail_boolean_cell_factory_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) 
-  {
-    static const GTypeInfo tinfo =
-    {
-      sizeof (GailBooleanCellFactoryClass),
-      (GBaseInitFunc) NULL, /* base init */
-      (GBaseFinalizeFunc) NULL, /* base finalize */
-      (GClassInitFunc) gail_boolean_cell_factory_class_init, /* class init */
-      (GClassFinalizeFunc) NULL, /* class finalize */
-      NULL, /* class data */
-      sizeof (GailBooleanCellFactory), /* instance size */
-      0, /* nb preallocs */
-      (GInstanceInitFunc) NULL, /* instance init */
-      NULL /* value table */
-    };
-    type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
-                           "GailBooleanCellFactory" , &tinfo, 0);
-  }
-
-  return type;
-}
-
-static void 
-gail_boolean_cell_factory_class_init (GailBooleanCellFactoryClass *klass)
-{
-  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
-  class->create_accessible = gail_boolean_cell_factory_create_accessible;
-  class->get_accessible_type = gail_boolean_cell_factory_get_accessible_type;
-}
-
-static AtkObject* 
-gail_boolean_cell_factory_create_accessible (GObject     *obj)
-{
-  g_return_val_if_fail (GTK_IS_CELL_RENDERER_TOGGLE (obj), NULL);
-
-  return gail_boolean_cell_new ();
-}
-
-static GType
-gail_boolean_cell_factory_get_accessible_type (void)
-{
-  return GAIL_TYPE_BOOLEAN_CELL;
-}
diff --git a/modules/other/gail/gailbooleancellfactory.h b/modules/other/gail/gailbooleancellfactory.h
deleted file mode 100644 (file)
index fca9c05..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_BOOLEAN_CELL_FACTORY_H__
-#define __GAIL_BOOLEAN_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_BOOLEAN_CELL_FACTORY                 (gail_boolean_cell_factory_get_type ())
-#define GAIL_BOOLEAN_CELL_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactory))
-#define GAIL_BOOLEAN_CELL_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
-#define GAIL_IS_BOOLEAN_CELL_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
-#define GAIL_IS_BOOLEAN_CELL_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BOOLEAN_CELL_FACTORY))
-#define GAIL_BOOLEAN_CELL_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BOOLEAN_CELL_FACTORY, GailBooleanCellFactoryClass))
-
-typedef struct _GailBooleanCellFactory             GailBooleanCellFactory;
-typedef struct _GailBooleanCellFactoryClass        GailBooleanCellFactoryClass;
-
-struct _GailBooleanCellFactory
-{
-  AtkObjectFactory parent;
-};
-
-struct _GailBooleanCellFactoryClass
-{
-  AtkObjectFactoryClass parent_class;
-};
-
-GType gail_boolean_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_BOOLEAN_CELL_FACTORY_H__ */
index 80c674b69fd5afa9d2d0c6fdc65ceffa3db65a0b..a087a75643bc8dc3d2a11ef05799676d6f759bc4 100644 (file)
@@ -24,6 +24,8 @@
 
 static void         gail_box_class_init            (GailBoxClass  *klass);
 static void         gail_box_init                  (GailBox       *box);
+static void         gail_box_initialize            (AtkObject     *accessible,
+                                                    gpointer       data);
 static AtkStateSet* gail_box_ref_state_set         (AtkObject     *accessible);
 
 G_DEFINE_TYPE (GailBox, gail_box, GAIL_TYPE_CONTAINER)
@@ -33,6 +35,7 @@ gail_box_class_init (GailBoxClass *klass)
 {
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_box_initialize;
   class->ref_state_set = gail_box_ref_state_set;
 }
 
@@ -41,22 +44,13 @@ gail_box_init (GailBox *box)
 {
 }
 
-AtkObject* 
-gail_box_new (GtkWidget *widget)
+static void
+gail_box_initialize (AtkObject *accessible,
+                     gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_BOX (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_BOX, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_box_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_FILLER;
-
-  return accessible;
 }
 
 static AtkStateSet*
index 17c00ece0fb310d2473bc9b555447d176a2c0908..64a90dd65e2dc4ac9c8f7d37c373b9255dee7de2 100644 (file)
@@ -49,8 +49,6 @@ struct _GailBoxClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_box_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 86ce14c71bf9e4500790695688a71a5c7291ee15..c2b8e8c700b159df6fab306c1594ebcf8f2ff1c0 100644 (file)
@@ -184,22 +184,6 @@ gail_button_init (GailButton *button)
   button->textutil = NULL;
 }
 
-AtkObject* 
-gail_button_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_BUTTON, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static G_CONST_RETURN gchar*
 gail_button_get_name (AtkObject *obj)
 {
index 2550af92159636ca49271df9d7fe66a26d3be569..7f3c30a76a5534af3d0bc5696cfe7ce425587875 100644 (file)
@@ -67,8 +67,6 @@ struct _GailButtonClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_button_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 1d739b8be9e2f67981c88d7a927dd4b6bcc6ff57..0711b00e58c0632207ce320ae3d05fb45d90c0be 100644 (file)
 
 static void         gail_calendar_class_init          (GailCalendarClass *klass);
 static void         gail_calendar_init                (GailCalendar      *calendar);
+static void         gail_calendar_initialize          (AtkObject         *accessible,
+                                                       gpointer           data);
 
 G_DEFINE_TYPE (GailCalendar, gail_calendar, GAIL_TYPE_WIDGET)
 
 static void
 gail_calendar_class_init (GailCalendarClass *klass)
 {
+  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+  atk_object_class->initialize = gail_calendar_initialize;
 }
 
 static void
@@ -37,20 +42,11 @@ gail_calendar_init (GailCalendar *calendar)
 {
 }
 
-AtkObject* 
-gail_calendar_new (GtkWidget *widget)
+static void
+gail_calendar_initialize (AtkObject *accessible,
+                          gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_CALENDAR (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_CALENDAR, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_calendar_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_CALENDAR;
-
-  return accessible;
 }
index 568f4c4784047f1ceb14330923f92929529ea1e8..ef6290b7c8d85266214fef457df25cb0d7505a31 100644 (file)
@@ -49,8 +49,6 @@ struct _GailCalendarClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_calendar_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 1c624c8f43345bd1557eaa573ab78d8560742388..93e19dceb831f7ab37d45beedbe51f73d3700eb5 100644 (file)
@@ -287,24 +287,6 @@ gail_clist_init (GailCList *clist)
 {
 }
 
-AtkObject* 
-gail_clist_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_CLIST (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_CLIST, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  accessible->role = ATK_ROLE_TABLE;
-
-  return accessible;
-}
-
 static void
 gail_clist_real_initialize (AtkObject *obj,
                             gpointer  data)
@@ -315,6 +297,8 @@ gail_clist_real_initialize (AtkObject *obj,
 
   ATK_OBJECT_CLASS (gail_clist_parent_class)->initialize (obj, data);
 
+  obj->role = ATK_ROLE_TABLE;
+
   clist = GAIL_CLIST (obj);
 
   clist->caption = NULL;
index 92d1df6929310c78ee14015ca84d3973aa159fed..d7b65a3e1b56c949ebd1a2ee14e61b78a2ac44a6 100644 (file)
@@ -62,8 +62,6 @@ struct _GailCListClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_clist_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index d96eef233f08612e78bb65934225ab5cedcdd36d..ccad014459ac39ae5a82486aec559b9534ea86d5 100644 (file)
@@ -91,22 +91,6 @@ gail_combo_init (GailCombo      *combo)
   combo->select_idle_handler = 0;
 }
 
-AtkObject* 
-gail_combo_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_COMBO (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_COMBO, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_combo_real_initialize (AtkObject *obj,
                             gpointer  data)
index c3e99c7725009894e4fe620e17055deb49138f22..6d99e7363865762b69ef59ae7cd1253062bc2065 100644 (file)
@@ -57,8 +57,6 @@ struct _GailComboClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_combo_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 6b90cbfcde5320611efc3f7195aab37ce7cf7496..f56f7cd64ef108527518c0433aba0f8901eefde1 100644 (file)
@@ -90,22 +90,6 @@ gail_combo_box_init (GailComboBox      *combo_box)
   combo_box->popup_set = FALSE;
 }
 
-AtkObject* 
-gail_combo_box_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_COMBO_BOX (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_COMBO_BOX, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_combo_box_real_initialize (AtkObject *obj,
                                 gpointer  data)
index f9307296d0de5ef3ab2d38c46a97316a6b2a9760..8de7d5589d2ea2e029527c2cb601cd5765da548a 100644 (file)
@@ -58,8 +58,6 @@ struct _GailComboBoxClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_combo_box_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index aa7bc102b6e59590a1316f8c07b442546d2bf256..486d072397bc29a16c26ff189eee81c46c745647 100644 (file)
@@ -70,23 +70,7 @@ gail_container_init (GailContainer      *container)
   container->children = NULL;
 }
 
-AtkObject* 
-gail_container_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_CONTAINER (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_CONTAINER, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
-static gint 
+static gint
 gail_container_get_n_children (AtkObject* obj)
 {
   GtkWidget *widget;
index 6f0f6195498c60801d8d13fa8f0a4ceff11cb640..fab2e5573bdb635b3f65db9a03b898960840acb4 100644 (file)
@@ -62,8 +62,6 @@ struct _GailContainerClass
                       gpointer     data);
 };
 
-AtkObject* gail_container_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index c45e2e1f17c0dc6436958dd9bb76a634e549d4a8..7d0ff6381b7f1022877c09721ae6825defcdddf8 100644 (file)
@@ -348,22 +348,6 @@ gail_entry_finalize (GObject            *object)
   G_OBJECT_CLASS (gail_entry_parent_class)->finalize (object);
 }
 
-AtkObject* 
-gail_entry_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_ENTRY (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_ENTRY, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static gint
 gail_entry_get_index_in_parent (AtkObject *accessible)
 {
index 1fa332f1c3342329f968959ff590df9e2f7b212d..aeed8456fde38d8beb7507840a28524b540be961 100644 (file)
@@ -68,8 +68,6 @@ struct _GailEntryClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_entry_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 006e95f87a658f7960569438c7f9152982705dde..d8e8450e9feed0ff83077b6979d8c0948f6dcf77 100644 (file)
@@ -144,22 +144,6 @@ gail_expander_init (GailExpander *expander)
   expander->textutil = NULL;
 }
 
-AtkObject* 
-gail_expander_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_EXPANDER, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static G_CONST_RETURN gchar*
 gail_expander_get_name (AtkObject *obj)
 {
index a1e8c29d054bb7a49ecd6884751a6661c89c69f9..94644c551e9922ea43a7036ef8d6937a6dd142dd 100644 (file)
@@ -56,8 +56,6 @@ struct _GailExpanderClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_expander_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 0ea4dbac4b632e91c135a9166ed0942478564141..453ccfd06d904febe0d820ed292cb97fccc3e875 100644 (file)
@@ -1,5 +1,7 @@
 /* GAIL - The GNOME Accessibility Implementation Library
  * Copyright 2002 Sun Microsystems Inc.
+ * Copyright (C) 1998-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+ * Copyright (C) 2007 Christian Persch
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
 #include <glib-object.h>
 #include <atk/atkobject.h>
 
-#define GAIL_ACCESSIBLE_FACTORY(type, type_as_function, opt_create_accessible) \
-                                                                               \
-static GType                                                                   \
-type_as_function ## _factory_get_accessible_type (void)                                \
-{                                                                              \
-  return type;                                                                 \
-}                                                                              \
-                                                                               \
-static AtkObject*                                                              \
-type_as_function ## _factory_create_accessible (GObject *obj)                  \
-{                                                                              \
-  GtkWidget *widget;                                                           \
-  AtkObject *accessible;                                                       \
-                                                                               \
-  g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL);                            \
-                                                                               \
-  widget = GTK_WIDGET (obj);                                                   \
-                                                                               \
-  accessible = opt_create_accessible (widget);                                 \
-                                                                               \
-  return accessible;                                                           \
-}                                                                              \
-                                                                               \
-static void                                                                    \
-type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass)         \
-{                                                                              \
-  klass->create_accessible   = type_as_function ## _factory_create_accessible; \
-  klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
-}                                                                              \
-                                                                               \
-static GType                                                                   \
-type_as_function ## _factory_get_type (void)                                   \
-{                                                                              \
-  static GType t = 0;                                                          \
-                                                                               \
-  if (!t)                                                                      \
-  {                                                                            \
-    char *name;                                                                        \
-    static const GTypeInfo tinfo =                                             \
-    {                                                                          \
-      sizeof (AtkObjectFactoryClass),                                  \
-      NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init,                    \
-      NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL                     \
-    };                                                                         \
-                                                                               \
-    name = g_strconcat (g_type_name (type), "Factory", NULL);                  \
-    t = g_type_register_static (                                               \
-           ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0);                          \
-    g_free (name);                                                             \
-  }                                                                            \
-                                                                               \
-  return t;                                                                    \
+#define _GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE(GAIL_TYPE, TYPE) \
+{ \
+  AtkObject *accessible; \
+\
+  g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL); \
+\
+  accessible = g_object_new (GAIL_TYPE, NULL); \
+  atk_object_initialize (accessible, object); \
+\
+  return accessible; \
 }
 
+#define _GAIL_IMPLEMENT_FACTORY_BEGIN(GAIL_TYPE, TypeName, type_name) \
+\
+static GType \
+type_name##_factory_get_accessible_type (void) \
+{ \
+  return GAIL_TYPE; \
+} \
+\
+static AtkObject* \
+type_name##_factory_create_accessible (GObject *object) \
+{
+
+#define _GAIL_IMPLEMENT_FACTORY_END(GAIL_TYPE, TypeName, type_name) \
+} \
+\
+static void \
+type_name##_factory_class_init (AtkObjectFactoryClass *klass) \
+{ \
+  klass->create_accessible   = type_name ## _factory_create_accessible;        \
+  klass->get_accessible_type = type_name ## _factory_get_accessible_type;\
+} \
+\
+GType \
+type_name##_factory_get_type (void) \
+{ \
+  static volatile gsize g_define_type_id__volatile = 0; \
+  if (g_once_init_enter (&g_define_type_id__volatile)) \
+    { \
+      GType g_define_type_id = \
+        g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY, \
+                                       g_intern_static_string (#TypeName "Factory"), \
+                                       sizeof (AtkObjectFactoryClass), \
+                                       (GClassInitFunc) type_name##_factory_class_init, \
+                                       sizeof (AtkObjectFactory), \
+                                       (GInstanceInitFunc) NULL, \
+                                       (GTypeFlags) 0); \
+      g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \
+    } \
+  return g_define_type_id__volatile; \
+}
+
+/* Implements a AtkObjectFactory creating accessibles of type
+ * @GAIL_TYPE for objects of type @TYPE.
+ */
+#define GAIL_IMPLEMENT_FACTORY(GAIL_TYPE, TypeName, type_name, TYPE) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+_GAIL_IMPLEMENT_FACTORY_CREATE_ACCESSIBLE (GAIL_TYPE, TYPE) \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
+/* Implements a AtkObjectFactory creating accessibles of type
+ * @GAIL_TYPE with creation func @create_accessible.
+ */
+#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC(GAIL_TYPE, TypeName, type_name, create_accessible) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+{ return create_accessible (GTK_WIDGET (object)); } \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
+#define GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY(GAIL_TYPE, TypeName, type_name, TYPE, create_accessible) \
+_GAIL_IMPLEMENT_FACTORY_BEGIN (GAIL_TYPE, TypeName, type_name) \
+{ \
+  g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object, TYPE), NULL);\
+  return create_accessible (); \
+} \
+_GAIL_IMPLEMENT_FACTORY_END (GAIL_TYPE, TypeName, type_name)
+
 #define GAIL_WIDGET_SET_FACTORY(widget_type, type_as_function)                 \
        atk_registry_set_factory_type (atk_get_default_registry (),             \
                                       widget_type,                             \
index ad82be6e56b9092f0a6021a6154ac699e556fe8f..2182fd0a048b4dcb378b9731f931798a87564342 100644 (file)
@@ -25,6 +25,8 @@
 
 static void                  gail_frame_class_init       (GailFrameClass  *klass);
 static void                  gail_frame_init             (GailFrame       *frame);
+static void                  gail_frame_initialize       (AtkObject       *accessible,
+                                                          gpointer         data);
 static G_CONST_RETURN gchar* gail_frame_get_name         (AtkObject       *obj);
 
 G_DEFINE_TYPE (GailFrame, gail_frame, GAIL_TYPE_CONTAINER)
@@ -34,6 +36,7 @@ gail_frame_class_init (GailFrameClass *klass)
 {
   AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_frame_initialize;
   class->get_name = gail_frame_get_name;
 }
 
@@ -42,22 +45,13 @@ gail_frame_init (GailFrame       *frame)
 {
 }
 
-AtkObject* 
-gail_frame_new (GtkWidget *widget)
+static void
+gail_frame_initialize (AtkObject *accessible,
+                       gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_FRAME (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_FRAME, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_frame_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_PANEL;
-
-  return accessible;
 }
 
 static G_CONST_RETURN gchar*
index 142c8deb793616d83b95d795c076674575abba01..4977ea04ba1f669ea15e3f6614b855b6e379eb70 100644 (file)
@@ -50,8 +50,6 @@ struct _GailFrameClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_frame_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index ed988a1f52453023f59fdd50e2dea2252155765c..5b2e5975831a672a383258f8ae5234f5a0206fae 100644 (file)
@@ -56,27 +56,16 @@ gail_html_box_class_init (GailHtmlBoxClass *klass)
   class->initialize = gail_html_box_initialize;
 }
 
-AtkObject*
-gail_html_box_new (GObject *obj)
-{
-  GObject *object;
-  AtkObject *atk_object;
-
-  g_return_val_if_fail (HTML_IS_BOX (obj), NULL);
-  object = g_object_new (GAIL_TYPE_HTML_BOX, NULL);
-  atk_object = ATK_OBJECT (object);
-  atk_object_initialize (atk_object, obj);
-  atk_object->role = ATK_ROLE_UNKNOWN;
-  return atk_object;
-}
-
 static void
 gail_html_box_initialize (AtkObject *obj,
                           gpointer  data)
 {
   HtmlBox *box;
+
   ATK_OBJECT_CLASS (gail_html_box_parent_class)->initialize (obj, data);
 
+  obj->role = ATK_ROLE_UNKNOWN;
+
   box = HTML_BOX (data);
 
   /*
index bf2200bbb85923fbb10df24790a6ea4776238110..c03215be784960e262ce875b24152ccaaa2ba53b 100644 (file)
@@ -48,8 +48,6 @@ struct _GailHtmlBoxClass
 
 GType gail_html_box_get_type (void);
 
-AtkObject* gail_html_box_new (GObject *obj);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index a2bed63de08bc104d43053ed8b5dc8e385ff5605..bb9b40ce3858d9c6006f45d209b23313d301064d 100644 (file)
@@ -25,6 +25,8 @@
 
 static void      gail_image_class_init         (GailImageClass *klass);
 static void      gail_image_init               (GailImage      *image);
+static void      gail_image_initialize         (AtkObject       *accessible,
+                                                gpointer        data);
 static G_CONST_RETURN gchar* gail_image_get_name  (AtkObject     *accessible);
 
 
@@ -53,6 +55,7 @@ gail_image_class_init (GailImageClass *klass)
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
 
   gobject_class->finalize = gail_image_finalize;
+  class->initialize = gail_image_initialize;
   class->get_name = gail_image_get_name;
 }
 
@@ -62,22 +65,13 @@ gail_image_init (GailImage *image)
   image->image_description = NULL;
 }
 
-AtkObject* 
-gail_image_new (GtkWidget *widget)
+static void
+gail_image_initialize (AtkObject *accessible,
+                       gpointer data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_IMAGE (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_IMAGE, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_image_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_ICON;
-
-  return accessible;
 }
 
 /* Copied from gtktoolbar.c, keep in sync */
index f13b64d07445c08f37cdf366ab3f60b72cfc9f66..6221fc0416b116c382ea3f5dffddd924f46e4a43 100644 (file)
@@ -52,8 +52,6 @@ struct _GailImageClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_image_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/modules/other/gail/gailimagecellfactory.c b/modules/other/gail/gailimagecellfactory.c
deleted file mode 100644 (file)
index e336e81..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrendererpixbuf.h>
-#include "gailimagecellfactory.h"
-#include "gailimagecell.h"
-
-static void gail_image_cell_factory_class_init (GailImageCellFactoryClass        *klass);
-
-static AtkObject* gail_image_cell_factory_create_accessible (
-                                GObject                              *obj);
-
-static GType gail_image_cell_factory_get_accessible_type (void);
-
-GType
-gail_image_cell_factory_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) 
-  {
-    static const GTypeInfo tinfo =
-    {
-      sizeof (GailImageCellFactoryClass),
-      (GBaseInitFunc) NULL, /* base init */
-      (GBaseFinalizeFunc) NULL, /* base finalize */
-      (GClassInitFunc) gail_image_cell_factory_class_init, /* class init */
-      (GClassFinalizeFunc) NULL, /* class finalize */
-      NULL, /* class data */
-      sizeof (GailImageCellFactory), /* instance size */
-      0, /* nb preallocs */
-      (GInstanceInitFunc) NULL, /* instance init */
-      NULL /* value table */
-    };
-    type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
-                           "GailImageCellFactory" , &tinfo, 0);
-  }
-
-  return type;
-}
-
-static void 
-gail_image_cell_factory_class_init (GailImageCellFactoryClass *klass)
-{
-  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
-  class->create_accessible = gail_image_cell_factory_create_accessible;
-  class->get_accessible_type = gail_image_cell_factory_get_accessible_type;
-}
-
-static AtkObject* 
-gail_image_cell_factory_create_accessible (GObject     *obj)
-{
-  g_return_val_if_fail (GTK_IS_CELL_RENDERER_PIXBUF (obj), NULL);
-
-  return gail_image_cell_new ();
-}
-
-static GType
-gail_image_cell_factory_get_accessible_type (void)
-{
-  return GAIL_TYPE_IMAGE_CELL;
-}
diff --git a/modules/other/gail/gailimagecellfactory.h b/modules/other/gail/gailimagecellfactory.h
deleted file mode 100644 (file)
index adf3fd2..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_IMAGE_CELL_FACTORY_H__
-#define __GAIL_IMAGE_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_IMAGE_CELL_FACTORY                 (gail_image_cell_factory_get_type ())
-#define GAIL_IMAGE_CELL_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactory))
-#define GAIL_IMAGE_CELL_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
-#define GAIL_IS_IMAGE_CELL_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY))
-#define GAIL_IS_IMAGE_CELL_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_IMAGE_CELL_FACTORY))
-#define GAIL_IMAGE_CELL_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_IMAGE_CELL_FACTORY, GailImageCellFactoryClass))
-
-typedef struct _GailImageCellFactory             GailImageCellFactory;
-typedef struct _GailImageCellFactoryClass        GailImageCellFactoryClass;
-
-struct _GailImageCellFactory
-{
-  AtkObjectFactory parent;
-};
-
-struct _GailImageCellFactoryClass
-{
-  AtkObjectFactoryClass parent_class;
-};
-
-GType gail_image_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_IMAGE_CELL_FACTORY_H__ */
index 7306b4c9b732d82747416cc9e39890f6f6ec809a..33bd311e71be8217afd4b293753764580c2acf07 100644 (file)
@@ -116,22 +116,6 @@ gail_item_init (GailItem      *item)
 {
 }
 
-AtkObject*
-gail_item_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_ITEM (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_ITEM, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_item_real_initialize (AtkObject *obj,
                            gpointer    data)
index 18e49461f31350b9e0891ca3988b858f44dbcba1..447ea38cbddc7aaba0e962f68ac7a98cc443f8ca 100644 (file)
@@ -54,8 +54,6 @@ struct _GailItemClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_item_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index f912fb463cd3cc21a273fd95345108fb9cd03d68..a54d637c4e9273700da6a067a46b263eef77177b 100644 (file)
@@ -208,22 +208,6 @@ gail_label_init_text_util (GailLabel *gail_label,
     gail_label->label_length = g_utf8_strlen (label_text, -1);
 }
 
-AtkObject* 
-gail_label_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_LABEL (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_LABEL, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 notify_name_change (AtkObject *atk_obj)
 {
index 3c927c44a044eb7c1c80370b43814b438a09a5fd..c3acf06ffae4cd32dbcc896a7d006baa87e55ab9 100644 (file)
@@ -57,8 +57,6 @@ struct _GailLabelClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_label_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 24097e6ed0b6dc1d40ed991299e21939615b2a33..de6160d676f45edb253790c1d396944f63c579dc 100644 (file)
@@ -27,6 +27,9 @@ static void         gail_list_class_init            (GailListClass  *klass);
 
 static void         gail_list_init                  (GailList       *list);
 
+static void         gail_list_initialize            (AtkObject      *accessible,
+                                                     gpointer        data);
+
 static gint         gail_list_get_index_in_parent   (AtkObject      *accessible);
 
 static void         atk_selection_interface_init    (AtkSelectionIface *iface);
@@ -50,6 +53,7 @@ gail_list_class_init (GailListClass *klass)
 {
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_list_initialize;
   class->get_index_in_parent = gail_list_get_index_in_parent;
 }
 
@@ -58,22 +62,13 @@ gail_list_init (GailList *list)
 {
 }
 
-AtkObject* 
-gail_list_new (GtkWidget *widget)
+static void
+gail_list_initialize (AtkObject *accessible,
+                      gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_LIST (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_LIST, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_list_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_LIST;
-
-  return accessible;
 }
 
 static gint
index cd57874bb85658c9fa1743b819a47bb95081cdd6..e937a10fa5ec09d28c5a8af1531dbeecadf21d45 100644 (file)
@@ -49,8 +49,6 @@ struct _GailListClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_list_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index d18a115ef684e3e90e68acfc34b37aeded6a38bb..57de76d681b4bd9f85764a4951352f8d35149165 100644 (file)
@@ -51,24 +51,6 @@ gail_menu_init (GailMenu *accessible)
 {
 }
 
-AtkObject*
-gail_menu_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_MENU (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_MENU, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  g_object_set_data (G_OBJECT (accessible), "atk-component-layer",
-                    GINT_TO_POINTER (ATK_LAYER_POPUP));
-  return accessible;
-}
-
 static void
 gail_menu_real_initialize (AtkObject *obj,
                            gpointer  data)
@@ -76,6 +58,9 @@ gail_menu_real_initialize (AtkObject *obj,
   ATK_OBJECT_CLASS (gail_menu_parent_class)->initialize (obj, data);
 
   obj->role = ATK_ROLE_MENU;
+
+  g_object_set_data (G_OBJECT (obj), "atk-component-layer",
+                    GINT_TO_POINTER (ATK_LAYER_POPUP));
 }
 
 static AtkObject*
index 5c1c5f9e72fb81afdb1d123253ce7d590e24f28d..3ce04157f9e6f8d6795db4ab4dcc20a92f2db79a 100644 (file)
@@ -50,8 +50,6 @@ struct _GailMenuClass
   GailMenuShellClass parent_class;
 };
 
-AtkObject* gail_menu_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 34ff98b5433c910e6e731e550bef91fe61ec8b78..0fe91f447963a63c3bbdee5aeaeb8940a561df64 100644 (file)
@@ -24,6 +24,8 @@
 
 static void         gail_menu_shell_class_init          (GailMenuShellClass *klass);
 static void         gail_menu_shell_init                (GailMenuShell      *menu_shell);
+static void         gail_menu_shell_initialize          (AtkObject          *accessible,
+                                                         gpointer            data);
 static void         atk_selection_interface_init        (AtkSelectionIface  *iface);
 static gboolean     gail_menu_shell_add_selection       (AtkSelection   *selection,
                                                          gint           i);
@@ -42,6 +44,9 @@ G_DEFINE_TYPE_WITH_CODE (GailMenuShell, gail_menu_shell, GAIL_TYPE_CONTAINER,
 static void
 gail_menu_shell_class_init (GailMenuShellClass *klass)
 {
+  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+  atk_object_class->initialize = gail_menu_shell_initialize;
 }
 
 static void
@@ -49,28 +54,19 @@ gail_menu_shell_init (GailMenuShell *menu_shell)
 {
 }
 
-AtkObject*
-gail_menu_shell_new (GtkWidget *widget)
+static void
+gail_menu_shell_initialize (AtkObject *accessible,
+                            gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), NULL);
+  ATK_OBJECT_CLASS (gail_menu_shell_parent_class)->initialize (accessible, data);
 
-  object = g_object_new (GAIL_TYPE_MENU_SHELL, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  if (GTK_IS_MENU_BAR (widget))
+  if (GTK_IS_MENU_BAR (data))
     accessible->role = ATK_ROLE_MENU_BAR;
   else
     /*
      * Accessible object for Menu is created in gailmenu.c
      */
     accessible->role = ATK_ROLE_UNKNOWN;
-
-  return accessible;
 }
 
 static void
index a44aa884e219b6dd475cb7d52502164df325aaca..0c099a051fc23e0d3b6f35c2e69057a53ac1bb35 100644 (file)
@@ -50,8 +50,6 @@ struct _GailMenuShellClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_menu_shell_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 8ffffd8fb4d1544bfde768018d138af615fa034d..b2c46d453ca8072f53a2a80102553c9e92a2f69a 100644 (file)
@@ -105,22 +105,6 @@ gail_notebook_init (GailNotebook      *notebook)
   notebook->idle_focus_id = 0;
 }
 
-AtkObject* 
-gail_notebook_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_NOTEBOOK, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static AtkObject*
 gail_notebook_ref_child (AtkObject      *obj,
                          gint           i)
index ab17ff1c31c683f58d53a31ec7ab1b1b7deb6f4f..f2226b5cf74d2422e7f711cf128b366014b4fe9f 100644 (file)
@@ -63,8 +63,6 @@ struct _GailNotebookClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_notebook_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 890195a2a125484eb8e23149fccdd40e086ad868..adfe59f596900c874aa77dedd80fd05b928368a6 100644 (file)
@@ -31,19 +31,6 @@ static void       gail_object_real_initialize          (AtkObject       *obj,
 
 G_DEFINE_TYPE (GailObject, gail_object, ATK_TYPE_GOBJECT_ACCESSIBLE)
 
-AtkObject*
-gail_object_new (GObject *obj)
-{
-  gpointer object;
-  AtkObject *atk_object;
-
-  g_return_val_if_fail (GTK_IS_OBJECT (obj), NULL);
-  object = g_object_new (GAIL_TYPE_OBJECT, NULL);
-  atk_object = ATK_OBJECT (object);
-  atk_object_initialize (atk_object, obj);
-  return atk_object;
-}
-
 static void
 gail_object_class_init (GailObjectClass *klass)
 {
index ffa36b3d181c532ab50bb6e415bdd1b0991bd503..fc981a9c080d7d0c9456e304f9aed52bac881337 100644 (file)
@@ -48,8 +48,6 @@ struct _GailObjectClass
   AtkGObjectAccessibleClass parent_class;
 };
 
-AtkObject* gail_object_new (GObject *obj);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/modules/other/gail/gailobjectfactory.c b/modules/other/gail/gailobjectfactory.c
deleted file mode 100644 (file)
index 7690187..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2003 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtk.h>
-#include "gailobjectfactory.h"
-#include "gailobject.h"
-
-static void gail_object_factory_class_init (GailObjectFactoryClass *klass);
-
-static AtkObject* gail_object_factory_create_accessible (GObject *obj);
-
-static GType gail_object_factory_get_accessible_type (void);
-
-GType
-gail_object_factory_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) 
-  {
-    static const GTypeInfo tinfo =
-    {
-      sizeof (GailObjectFactoryClass),
-      (GBaseInitFunc) NULL, /* base init */
-      (GBaseFinalizeFunc) NULL, /* base finalize */
-      (GClassInitFunc) gail_object_factory_class_init, /* class init */
-      (GClassFinalizeFunc) NULL, /* class finalize */
-      NULL, /* class data */
-      sizeof (GailObjectFactory), /* instance size */
-      0, /* nb preallocs */
-      (GInstanceInitFunc) NULL, /* instance init */
-      NULL /* value table */
-    };
-    type = g_type_register_static (
-                           ATK_TYPE_OBJECT_FACTORY, 
-                           "GailObjectFactory" , &tinfo, 0);
-  }
-
-  return type;
-}
-
-static void 
-gail_object_factory_class_init (GailObjectFactoryClass *klass)
-{
-  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
-  class->create_accessible = gail_object_factory_create_accessible;
-  class->get_accessible_type = gail_object_factory_get_accessible_type;
-}
-
-static AtkObject* 
-gail_object_factory_create_accessible (GObject   *obj)
-{
-  return gail_object_new (obj);
-}
-
-static GType
-gail_object_factory_get_accessible_type (void)
-{
-  return GAIL_TYPE_OBJECT;
-}
diff --git a/modules/other/gail/gailobjectfactory.h b/modules/other/gail/gailobjectfactory.h
deleted file mode 100644 (file)
index 5b8fef8..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2003 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_OBJECT_FACTORY_H__
-#define __GAIL_OBJECT_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_OBJECT_FACTORY                 (gail_object_factory_get_type ())
-#define GAIL_OBJECT_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactory))
-#define GAIL_OBJECT_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
-#define GAIL_IS_OBJECT_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_OBJECT_FACTORY))
-#define GAIL_IS_OBJECT_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_OBJECT_FACTORY))
-#define GAIL_OBJECT_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_OBJECT_FACTORY, GailObjectFactoryClass))
-
-
-typedef struct _GailObjectFactory                GailObjectFactory;
-typedef struct _GailObjectFactoryClass           GailObjectFactoryClass;
-
-struct _GailObjectFactory
-{
-  AtkObjectFactory parent;
-};
-
-struct _GailObjectFactoryClass
-{
-  AtkObjectFactoryClass parent_class;
-};
-
-GType gail_object_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_OBJECT_FACTORY_H__ */
-
index 59ae7cd7999b76769a7dcafa353503d3e613729c..8c67ce3556d2f728f855fced10a05c9ae68a6afd 100644 (file)
@@ -78,22 +78,6 @@ gail_option_menu_init (GailOptionMenu  *menu)
 {
 }
 
-AtkObject* 
-gail_option_menu_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_OPTION_MENU, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_option_menu_real_initialize (AtkObject *obj,
                                   gpointer  data)
index dfd42a5e0d04d1dc2c4645e1e3a9802a5ce715b2..0e7bd186e2de83bdd14399113140cdb4e62b28a8 100644 (file)
@@ -50,8 +50,6 @@ struct _GailOptionMenuClass
   GailButtonClass parent_class;
 };
 
-AtkObject* gail_option_menu_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index c276c100fb9c0482a0c29d4f22f51c7735229ce9..9f157f1caf3176f29f8f48c46b217be7d7a0f060 100644 (file)
@@ -61,22 +61,6 @@ gail_paned_init (GailPaned *paned)
 {
 }
 
-AtkObject* 
-gail_paned_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_PANED (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_PANED, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static AtkStateSet*
 gail_paned_ref_state_set (AtkObject *accessible)
 {
index 0726025c452f25876eb39026d3521f7d0a595e58..bcf90c725f61fb945214b611851e37a1380f0e44 100644 (file)
@@ -49,8 +49,6 @@ struct _GailPanedClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_paned_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 2497c0072d6c05b8222048772af97b5511e252a4..108933fb325a696d1fa4d5d952fc8330c6d74a5f 100644 (file)
@@ -24,6 +24,8 @@
 
 static void     gail_pixmap_class_init         (GailPixmapClass *klass);
 static void      gail_pixmap_init               (GailPixmap      *pixmap);
+static void      gail_pixmap_initialize         (AtkObject       *accessible,
+                                                 gpointer         data);
 
 /* AtkImage */
 static void  atk_image_interface_init   (AtkImageIface  *iface);
@@ -49,7 +51,10 @@ static void
 gail_pixmap_class_init (GailPixmapClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
  
+  atk_object_class->initialize = gail_pixmap_initialize;
+
   gobject_class->finalize = gail_pixmap_finalize;
 }
 
@@ -59,23 +64,13 @@ gail_pixmap_init (GailPixmap *pixmap)
   pixmap->image_description = NULL;
 }
 
-AtkObject* 
-gail_pixmap_new (GtkWidget *widget)
+static void
+gail_pixmap_initialize (AtkObject *accessible,
+                        gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_assert (GTK_IS_PIXMAP (widget));
-  g_return_val_if_fail (GTK_IS_PIXMAP (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_PIXMAP, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_pixmap_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_ICON;
-
-  return accessible;
 }
 
 static void
index 889562a6650d79b095424f65168526b61227e172..e77d1081f93773fc820621792380e164ed02ad01 100644 (file)
@@ -52,12 +52,9 @@ struct _GailPixmapClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_pixmap_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
 
 #endif /* __GAIL_PIXMAP_H__ */
-
index 0523bd0e9d5e4a2a37f0433ff0e8cdfb9bc37b5d..80053c60511b1bf8ce15ea59bee04ecdcb58227b 100644 (file)
@@ -70,22 +70,6 @@ gail_progress_bar_init (GailProgressBar *bar)
 {
 }
 
-AtkObject* 
-gail_progress_bar_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_PROGRESS_BAR (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_PROGRESS_BAR, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_progress_bar_real_initialize (AtkObject *obj,
                                    gpointer  data)
index 441cb36d6110f88b2f2ef782924fc447a855aadb..2f0e0241396c2fdc9f8f7cf2a2733757525afc7e 100644 (file)
@@ -52,13 +52,9 @@ struct _GailProgressBarClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_progress_bar_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
 
 #endif /* __GAIL_PROGRESS_BAR_H__ */
-
-
index 330dd54a82510f4db8c74218b8a77f9d2abf98dc..d9363d75911594e4e46e3ca67e75d329beebeeb4 100644 (file)
@@ -24,6 +24,8 @@
 
 static void      gail_radio_button_class_init        (GailRadioButtonClass *klass);
 static void      gail_radio_button_init              (GailRadioButton      *radio_button);
+static void      gail_radio_button_initialize        (AtkObject            *accessible,
+                                                      gpointer              data);
 
 static AtkRelationSet* gail_radio_button_ref_relation_set (AtkObject       *obj);
 
@@ -34,30 +36,23 @@ gail_radio_button_class_init (GailRadioButtonClass *klass)
 {
   AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_radio_button_initialize;
   class->ref_relation_set = gail_radio_button_ref_relation_set;
 }
 
-AtkObject* 
-gail_radio_button_new (GtkWidget *widget)
+static void
+gail_radio_button_init (GailRadioButton *radio_button)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_RADIO_BUTTON (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_RADIO_BUTTON, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  accessible->role = ATK_ROLE_RADIO_BUTTON;
-  return accessible;
+  radio_button->old_group = NULL;
 }
 
 static void
-gail_radio_button_init (GailRadioButton *radio_button)
+gail_radio_button_initialize (AtkObject *accessible,
+                              gpointer  data)
 {
-  radio_button->old_group = NULL;
+  ATK_OBJECT_CLASS (gail_radio_button_parent_class)->initialize (accessible, data);
+
+  accessible->role = ATK_ROLE_RADIO_BUTTON;
 }
 
 AtkRelationSet*
index d48106bf2be0ac753b66dd6c0f011b5c3105b9cd..92089a96bf0ca4fc3b670ea380540358c166cdd5 100644 (file)
@@ -51,8 +51,6 @@ struct _GailRadioButtonClass
   GailToggleButtonClass parent_class;
 };
 
-AtkObject* gail_radio_button_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index ff260325bcd125e266d32347b0bc9f5def218744..7df51cb6a01fa11d8fc6b9245e6f6198eafe7b05 100644 (file)
@@ -94,22 +94,6 @@ gail_range_init (GailRange      *range)
 {
 }
 
-AtkObject* 
-gail_range_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_RANGE, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_range_real_initialize (AtkObject *obj,
                             gpointer  data)
index ad6bcd45b3a23e9a2106cde00ef641bc031f0640..c394c3382b7560e4e3f82d8a36296a9179b500ba 100644 (file)
@@ -56,8 +56,6 @@ struct _GailRangeClass
   GailWidgetClass parent_class;
 };
 
-AtkObject* gail_range_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/modules/other/gail/gailrenderercellfactory.c b/modules/other/gail/gailrenderercellfactory.c
deleted file mode 100644 (file)
index 90d5fa3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2004 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderer.h>
-#include "gailrenderercellfactory.h"
-#include "gailrenderercell.h"
-
-static void gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass        *klass);
-
-static AtkObject* gail_renderer_cell_factory_create_accessible (
-                                GObject                              *obj);
-static GType gail_renderer_cell_factory_get_accessible_type (void);
-
-GType
-gail_renderer_cell_factory_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) 
-  {
-    static const GTypeInfo tinfo =
-    {
-      sizeof (GailRendererCellFactoryClass),
-      (GBaseInitFunc) NULL, /* base init */
-      (GBaseFinalizeFunc) NULL, /* base finalize */
-      (GClassInitFunc) gail_renderer_cell_factory_class_init, /* class init */
-      (GClassFinalizeFunc) NULL, /* class finalize */
-      NULL, /* class data */
-      sizeof (GailRendererCellFactory), /* instance size */
-      0, /* nb preallocs */
-      (GInstanceInitFunc) NULL, /* instance init */
-      NULL /* value table */
-    };
-    type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
-                           "GailRendererCellFactory" , &tinfo, 0);
-  }
-
-  return type;
-}
-
-static void 
-gail_renderer_cell_factory_class_init (GailRendererCellFactoryClass *klass)
-{
-  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
-  class->create_accessible = gail_renderer_cell_factory_create_accessible;
-  class->get_accessible_type = gail_renderer_cell_factory_get_accessible_type;
-}
-
-static AtkObject* 
-gail_renderer_cell_factory_create_accessible (GObject *obj)
-{
-  g_return_val_if_fail (GTK_IS_CELL_RENDERER (obj), NULL);
-
-  return gail_renderer_cell_new ();
-}
-
-static GType
-gail_renderer_cell_factory_get_accessible_type (void)
-{
-  return GAIL_TYPE_RENDERER_CELL;
-}
diff --git a/modules/other/gail/gailrenderercellfactory.h b/modules/other/gail/gailrenderercellfactory.h
deleted file mode 100644 (file)
index 6368981..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2004 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_RENDERER_CELL_FACTORY_H__
-#define __GAIL_RENDERER_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_RENDERER_CELL_FACTORY                 (gail_renderer_cell_factory_get_type ())
-#define GAIL_RENDERER_CELL_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactory))
-#define GAIL_RENDERER_CELL_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
-#define GAIL_IS_RENDERER_CELL_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY))
-#define GAIL_IS_RENDERER_CELL_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_RENDERER_CELL_FACTORY))
-#define GAIL_RENDERER_CELL_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_RENDERER_CELL_FACTORY, GailRendererCellFactoryClass))
-
-typedef struct _GailRendererCellFactory             GailRendererCellFactory;
-typedef struct _GailRendererCellFactoryClass        GailRendererCellFactoryClass;
-
-struct _GailRendererCellFactory
-{
-  AtkObjectFactory parent;
-};
-
-struct _GailRendererCellFactoryClass
-{
-  AtkObjectFactoryClass parent_class;
-};
-
-GType gail_renderer_cell_factory_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_RENDERER_CELL_FACTORY_H__ */
index e82ce5b4c4b5d863738eb0c8170f05fffaf27197..17372141ca3292f5dfc9eae2f3597e34cff10bfb 100644 (file)
@@ -96,22 +96,6 @@ gail_scale_class_init (GailScaleClass *klass)
   gobject_class->notify = gail_scale_notify;
 }
 
-AtkObject* 
-gail_scale_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_RANGE (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_SCALE, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_scale_init (GailScale      *scale)
 {
index 22638a3d176fd1b3e6a1c3a6004d0a1e9753f76a..9e0687a0a616fefe0ff6cda6e7602de5d4ed84c0 100644 (file)
@@ -52,8 +52,6 @@ struct _GailScaleClass
   GailRangeClass parent_class;
 };
 
-AtkObject* gail_scale_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index f696cbc30b075c97c89c712fffbae2149b017550..0e922247c2c0d43b6f40243250dfa7fa94341933 100644 (file)
@@ -24,6 +24,8 @@
 
 static void gail_scrollbar_class_init  (GailScrollbarClass *klass);
 static void gail_scrollbar_init        (GailScrollbar      *accessible);
+static void gail_scrollbar_initialize  (AtkObject           *accessible,
+                                        gpointer             data);
 
 static gint gail_scrollbar_get_index_in_parent (AtkObject *accessible);
 
@@ -34,6 +36,7 @@ gail_scrollbar_class_init (GailScrollbarClass *klass)
 {
   AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_scrollbar_initialize;
   class->get_index_in_parent = gail_scrollbar_get_index_in_parent;
 }
 
@@ -42,22 +45,13 @@ gail_scrollbar_init (GailScrollbar      *accessible)
 {
 }
 
-AtkObject* 
-gail_scrollbar_new (GtkWidget *widget)
+static void
+gail_scrollbar_initialize (AtkObject *accessible,
+                           gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_SCROLLBAR (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_SCROLLBAR, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_scrollbar_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_SCROLL_BAR;
-
-  return accessible;
 }
 
 static gint
index 985a71641b6c8d580958bb5a072705ced126897c..624aedef1ca53632486f8ee6ff95e1eb35f48129 100644 (file)
@@ -50,8 +50,6 @@ struct _GailScrollbarClass
   GailRangeClass parent_class;
 };
 
-AtkObject* gail_scrollbar_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 49ca6e1a9d490e40ffdcd0ad91f138c59a1a4952..eb7ad6acc4919ee64498e6f53581fd6af777a403 100644 (file)
@@ -55,22 +55,6 @@ gail_scrolled_window_init (GailScrolledWindow *window)
 {
 }
 
-AtkObject* 
-gail_scrolled_window_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-  
-  g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_SCROLLED_WINDOW, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_scrolled_window_real_initialize (AtkObject *obj,
                                       gpointer  data)
index 0812823a667ef0ae36444683df4eca510c974e51..b8564780f3f2ee3f91c4b02c2c3bb0c1e009cc0c 100644 (file)
@@ -49,8 +49,6 @@ struct _GailScrolledWindowClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_scrolled_window_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 650e9378f3d5339ebe57f6e6634ab49e21048c9f..d8fbb7c89d62b5dfe4a640b442f9b9f33d6dd53b 100644 (file)
@@ -24,6 +24,8 @@
 
 static void         gail_separator_class_init            (GailSeparatorClass  *klass);
 static void         gail_separator_init                  (GailSeparator       *accessible);
+static void         gail_separator_initialize            (AtkObject           *accessible,
+                                                          gpointer             data);
 static AtkStateSet* gail_separator_ref_state_set        (AtkObject           *accessible);
 
 G_DEFINE_TYPE (GailSeparator, gail_separator, GAIL_TYPE_WIDGET)
@@ -33,6 +35,7 @@ gail_separator_class_init (GailSeparatorClass *klass)
 {
   AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
 
+  class->initialize = gail_separator_initialize;
   class->ref_state_set = gail_separator_ref_state_set;
 }
 
@@ -41,24 +44,13 @@ gail_separator_init (GailSeparator *accessible)
 {
 }
 
-AtkObject* 
-gail_separator_new (GtkWidget *widget)
+static void
+gail_separator_initialize (AtkObject *accessible,
+                           gpointer  data)
 {
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_SEPARATOR (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_SEPARATOR, NULL);
-
-  g_return_val_if_fail (GTK_IS_ACCESSIBLE (object), NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
+  ATK_OBJECT_CLASS (gail_separator_parent_class)->initialize (accessible, data);
 
   accessible->role = ATK_ROLE_SEPARATOR;
-
-  return accessible;
 }
 
 static AtkStateSet*
index 765b73cf364a290dc7d85558c6b3039c9b9058b0..94420edcd6a09ddffe4b73622cc5e5f1b6540262 100644 (file)
@@ -49,8 +49,6 @@ struct _GailSeparatorClass
   GailWidgetClass parent_class;
 };
 
-AtkObject *gail_separator_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 2c1589b283a72151f18603fe062ed000935f9264..e4ec43e051932c18534f50ebc2e643a919509b87 100644 (file)
@@ -71,22 +71,6 @@ gail_spin_button_init (GailSpinButton *button)
 {
 }
 
-AtkObject* 
-gail_spin_button_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_SPIN_BUTTON (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_SPIN_BUTTON, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_spin_button_real_initialize (AtkObject *obj,
                                   gpointer  data)
index 90e8f4ab7925278f833b9a7ead39d854428011e2..140ac94dcd0ea68f30567682cacc688070e4b6e5 100644 (file)
@@ -51,8 +51,6 @@ struct _GailSpinButtonClass
   GailEntryClass parent_class;
 };
 
-AtkObject* gail_spin_button_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 2c36b7a8f223905dc3a29dfc177c16bcbeecb91f..86656ab399e76c250b4d7e724816588a8c8bbda4 100644 (file)
@@ -119,22 +119,6 @@ gail_statusbar_init (GailStatusbar *bar)
 {
 }
 
-AtkObject* 
-gail_statusbar_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_STATUSBAR (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_STATUSBAR, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static G_CONST_RETURN gchar*
 gail_statusbar_get_name (AtkObject *obj)
 {
index 43d25f33f0c819eb55354b68ffeb26d28aca521d..52efc25bf8530739a77004b9455ee679ad35107f 100644 (file)
@@ -52,8 +52,6 @@ struct _GailStatusbarClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_statusbar_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/modules/other/gail/gailtextcellfactory.c b/modules/other/gail/gailtextcellfactory.c
deleted file mode 100644 (file)
index d735684..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkcellrenderertext.h>
-#include "gailtextcellfactory.h"
-#include "gailtextcell.h"
-
-static void gail_text_cell_factory_class_init (GailTextCellFactoryClass        *klass);
-
-static AtkObject* gail_text_cell_factory_create_accessible (
-                                GObject                              *obj);
-
-static GType gail_text_cell_factory_get_accessible_type (void);
-
-GType
-gail_text_cell_factory_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) 
-  {
-    static const GTypeInfo tinfo =
-    {
-      sizeof (GailTextCellFactoryClass),
-      (GBaseInitFunc) NULL, /* base init */
-      (GBaseFinalizeFunc) NULL, /* base finalize */
-      (GClassInitFunc) gail_text_cell_factory_class_init, /* class init */
-      (GClassFinalizeFunc) NULL, /* class finalize */
-      NULL, /* class data */
-      sizeof (GailTextCellFactory), /* instance size */
-      0, /* nb preallocs */
-      (GInstanceInitFunc) NULL, /* instance init */
-      NULL /* value table */
-    };
-    type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
-                           "GailTextCellFactory" , &tinfo, 0);
-  }
-
-  return type;
-}
-
-static void 
-gail_text_cell_factory_class_init (GailTextCellFactoryClass *klass)
-{
-  AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
-
-  class->create_accessible = gail_text_cell_factory_create_accessible;
-  class->get_accessible_type = gail_text_cell_factory_get_accessible_type;
-}
-
-static AtkObject* 
-gail_text_cell_factory_create_accessible (GObject     *obj)
-{
-  g_return_val_if_fail (GTK_IS_CELL_RENDERER_TEXT (obj), NULL);
-
-  return gail_text_cell_new ();
-}
-
-static GType
-gail_text_cell_factory_get_accessible_type (void)
-{
-  return GAIL_TYPE_TEXT_CELL;
-}
diff --git a/modules/other/gail/gailtextcellfactory.h b/modules/other/gail/gailtextcellfactory.h
deleted file mode 100644 (file)
index 1aae137..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_TEXT_CELL_FACTORY_H__
-#define __GAIL_TEXT_CELL_FACTORY_H__
-
-#include <atk/atkobjectfactory.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define GAIL_TYPE_TEXT_CELL_FACTORY                 (gail_text_cell_factory_get_type ())
-#define GAIL_TEXT_CELL_FACTORY(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactory))
-#define GAIL_TEXT_CELL_FACTORY_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), AGTK_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
-#define GAIL_IS_TEXT_CELL_FACTORY(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_TEXT_CELL_FACTORY))
-#define GAIL_IS_TEXT_CELL_FACTORY_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_TEXT_CELL_FACTORY))
-#define GAIL_TEXT_CELL_FACTORY_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_TEXT_CELL_FACTORY, GailTextCellFactoryClass))
-
-typedef struct _GailTextCellFactory             GailTextCellFactory;
-typedef struct _GailTextCellFactoryClass        GailTextCellFactoryClass;
-
-struct _GailTextCellFactory
-{
-  AtkObjectFactory parent;
-};
-
-struct _GailTextCellFactoryClass
-{
-  AtkObjectFactoryClass parent_class;
-};
-
-GType gail_text_cell_factory_get_type(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GAIL_TEXT_CELL_FACTORY_H__ */
index 87e0bc302b489c631545330b4d20f71a4d362faa..726aac16c0f881e6e4c0c6aebfd666338c3b4bb2 100644 (file)
@@ -265,22 +265,6 @@ gail_text_view_finalize (GObject            *object)
   G_OBJECT_CLASS (gail_text_view_parent_class)->finalize (object);
 }
 
-AtkObject*
-gail_text_view_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_TEXT_VIEW (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_TEXT_VIEW, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_text_view_real_notify_gtk (GObject             *obj,
                                 GParamSpec          *pspec)
index 4218b7b8407400d05a9189a4c39edd2d4c0dcd8f..4dfd48e9eac956fa2b7978d28b1ab375081f2af4 100644 (file)
@@ -62,8 +62,6 @@ struct _GailTextViewClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_text_view_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 377004d922077a7e9b48c1018c36bfc7741505cb..851e8ae60f520095a373d2780ec8844967283a83 100644 (file)
@@ -57,22 +57,6 @@ gail_toggle_button_init (GailToggleButton *button)
 {
 }
 
-AtkObject* 
-gail_toggle_button_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_TOGGLE_BUTTON, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_toggle_button_real_initialize (AtkObject *obj,
                                     gpointer  data)
index 77580f26b5b70a23dbc55b586937f4342c7ba635..b390d8356dd0c2adfb2956309c3ef7c109138d8b 100644 (file)
@@ -49,8 +49,6 @@ struct _GailToggleButtonClass
   GailButtonClass parent_class;
 };
 
-AtkObject* gail_toggle_button_new( GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index a9297a770263c4c30913c613f37aff81af9f1ec4..0284a9df5b9f88b76e28fc6d201066410d442128 100644 (file)
@@ -26,6 +26,8 @@
 
 static void             gail_toplevel_class_init        (GailToplevelClass      *klass);
 static void             gail_toplevel_init              (GailToplevel           *toplevel);
+static void             gail_toplevel_initialize        (AtkObject              *accessible,
+                                                         gpointer                data);
 static void             gail_toplevel_object_finalize   (GObject                *obj);
 
 /* atkobject.h */
@@ -59,29 +61,13 @@ static gboolean  is_combo_window                        (GtkWidget
 
 G_DEFINE_TYPE (GailToplevel, gail_toplevel, ATK_TYPE_OBJECT)
 
-AtkObject*
-gail_toplevel_new (void)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  object = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
-  g_return_val_if_fail ((object != NULL), NULL);
-
-  accessible = ATK_OBJECT (object);
-  accessible->role = ATK_ROLE_APPLICATION;
-  accessible->name = g_get_prgname();
-  accessible->accessible_parent = NULL;
-
-  return accessible;
-}
-
 static void
 gail_toplevel_class_init (GailToplevelClass *klass)
 {
   AtkObjectClass *class = ATK_OBJECT_CLASS(klass);
   GObjectClass *g_object_class = G_OBJECT_CLASS(klass);
 
+  class->initialize = gail_toplevel_initialize;
   class->get_n_children = gail_toplevel_get_n_children;
   class->ref_child = gail_toplevel_ref_child;
   class->get_parent = gail_toplevel_get_parent;
@@ -135,6 +121,17 @@ gail_toplevel_init (GailToplevel *toplevel)
     gail_toplevel_hide_event_watcher, toplevel, (GDestroyNotify) NULL);
 }
 
+static void
+gail_toplevel_initialize (AtkObject *accessible,
+                          gpointer  data)
+{
+  ATK_OBJECT_CLASS (gail_toplevel_parent_class)->initialize (accessible, data);
+
+  accessible->role = ATK_ROLE_APPLICATION;
+  accessible->name = g_get_prgname();
+  accessible->accessible_parent = NULL;
+}
+
 static void
 gail_toplevel_object_finalize (GObject *obj)
 {
index 5044a415263ee26f0ec6fff09f8803104f3cc831..82ee7f58a86394f58e31a1fad8829bf2e7f0b742 100644 (file)
@@ -49,8 +49,6 @@ struct _GailToplevelClass
   AtkObjectClass parent_class;
 };
 
-AtkObject *gail_toplevel_new(void);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index f71b026c47c64f53321a1afb8c3f5ca30b61685f..e2814127db12090f95da1c1c9b3a64acb542617e 100644 (file)
@@ -608,22 +608,6 @@ gail_tree_view_real_notify_gtk (GObject             *obj,
     GAIL_WIDGET_CLASS (gail_tree_view_parent_class)->notify_gtk (obj, pspec);
 }
 
-AtkObject*
-gail_tree_view_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_TREE_VIEW, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static void
 gail_tree_view_finalize (GObject           *object)
 {
index 655b876a76290e7bfbbebac9ae9a84ea53931d43..fd8a43fd1131e7437b04520cd540c5314beb224f 100644 (file)
@@ -66,8 +66,6 @@ struct _GailTreeViewClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_tree_view_new (GtkWidget *widget);
-
 AtkObject* gail_tree_view_ref_focus_cell (GtkTreeView *treeview);
  
 #ifdef __cplusplus
index bf2121727156708b106d25e8fcbf2b72718500bf..d0607411bc8f05b0bf1eeb55705c106b86f59290 100644 (file)
@@ -309,7 +309,10 @@ static AtkObject*
 gail_util_get_root (void)
 {
   if (!root)
-    root = gail_toplevel_new();
+    {
+      root = g_object_new (GAIL_TYPE_TOPLEVEL, NULL);
+      atk_object_initialize (root, NULL);
+    }
 
   return root;
 }
index 4a35c3c939721aacac079089e14d0c551361edae..5ad2a9e2bc207e5076fd0c6d60d083755ff85ad8 100644 (file)
@@ -174,35 +174,6 @@ gail_window_class_init (GailWindowClass *klass)
                   G_TYPE_NONE, 0);
 }
 
-AtkObject*
-gail_window_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  gail_return_val_if_fail (widget != NULL, NULL);
-  /*
-   * A GailWindow can be created for a GtkHandleBox or a GtkWindow
-   */
-  if (!GTK_IS_WINDOW (widget) &&
-      !GTK_IS_HANDLE_BOX (widget))
-    gail_return_val_if_fail (FALSE, NULL);
-
-  object = g_object_new (GAIL_TYPE_WINDOW, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  /*
-   * Notify that tooltip is showing
-   */
-  if (accessible->role == ATK_ROLE_TOOL_TIP &&
-      GTK_WIDGET_MAPPED (widget))
-    atk_object_notify_state_change (accessible, ATK_STATE_SHOWING, 1);
-
-  return accessible;
-}
-
 static void
 gail_window_init (GailWindow   *accessible)
 {
@@ -215,6 +186,13 @@ gail_window_real_initialize (AtkObject *obj,
   GtkWidget *widget;
   GailWindow *window;
 
+  /*
+   * A GailWindow can be created for a GtkHandleBox or a GtkWindow
+   */
+  if (!GTK_IS_WINDOW (widget) &&
+      !GTK_IS_HANDLE_BOX (widget))
+    gail_return_if_fail (FALSE);
+
   ATK_OBJECT_CLASS (gail_window_parent_class)->initialize (obj, data);
 
   window = GAIL_WINDOW (obj);
@@ -254,6 +232,13 @@ gail_window_real_initialize (AtkObject *obj,
       else
         obj->role = ATK_ROLE_FRAME;
     }
+
+  /*
+   * Notify that tooltip is showing
+   */
+  if (obj->role == ATK_ROLE_TOOL_TIP &&
+      GTK_WIDGET_MAPPED (widget))
+    atk_object_notify_state_change (obj, ATK_STATE_SHOWING, 1);
 }
 
 static void
index 289f83d1bea12fd53d74f39fe53b445b51a89b27..0b195072e697fc40a617203689d080b5f56ed227 100644 (file)
@@ -53,8 +53,6 @@ struct _GailWindowClass
   GailContainerClass parent_class;
 };
 
-AtkObject* gail_window_new (GtkWidget *widget);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */